<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../../../mui/css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="../../../css/app.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/icons-extra.css" />
		<style>
			.mui-table-view {
				margin-top: 15px;
			}
			
			.head {
				height: 40px;
			}
			
			#head {
				line-height: 40px;
			}
			
			.head-img {
				width: 40px;
				height: 40px;
			}
			
			#head-img1 {
				position: absolute;
				bottom: 10px;
				right: 40px;
				width: 40px;
				height: 40px;
			}
		</style>

	</head>

	<body>

		<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">个人中心</h1>
	</header>
	<nav class="mui-bar mui-bar-tab">
		<a id='home' class="mui-tab-item">
			<span class="mui-icon mui-icon-home"></span>
			<span class="mui-tab-label">首页</span>
		</a>
		<a id='sort' class="mui-tab-item">
			<span class="mui-icon mui-icon-email"></span>
			<span class="mui-tab-label">分类</span>
		</a>
		<a id='cart' class="mui-tab-item">
			<span class="mui-icon mui-icon-contact"></span>
			<span class="mui-tab-label">购物车</span>
		</a>
		<a id='user' class="mui-tab-item mui-active">
			<span class="mui-icon mui-icon-gear"></span>
			<span class="mui-tab-label">会员</span>
		</a>
	</nav>
	<div class="mui-content">
		<div class="mui-content">
			<ul class="mui-table-view mui-table-view-chevron " id="wechat">
			</ul>
			<ul class="mui-table-view mui-table-view-chevron" >
				<li class="mui-table-view-cell" >
					<a id="allOrder" class="mui-navigate-right">全部订单</a>
				</li>
				<ul class="mui-table-view mui-grid-view " style="margin-top: 0px;">
					<li class="mui-table-view-cell mui-media mui-col-xs-4 ">
						<a id="pendingPay">
							<span class="mui-icon mui-icon-home"></span>
							<div class="mui-media-body">待付款</div>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media mui-col-xs-4">
						<a id="pendingGoods">
							<span class="mui-icon mui-icon-email"></span>
							<div class="mui-media-body">待收货</div>
						</a>
					</li>
					<li class="mui-table-view-cell mui-media mui-col-xs-4 ">
						<a id="pendingeValuated" href="comment.html">
							<span class="mui-icon mui-icon-chatbubble"></span>
							<div class="mui-media-body">待评价</div>
						</a>
					</li>
				</ul>
			</ul>
			<ul class="mui-table-view mui-table-view-chevron">
				<li class="mui-table-view-cell">
					<a href="collection.html" class="mui-navigate-right">我的收藏</a>
				</li>
				<li class="mui-table-view-cell">
					<a id="address" onclick="ajaxContent('/address/list');" class="mui-navigate-right">我的地址</a>
				</li>
				<li class="mui-table-view-cell">
					<a href="coupon.html" class="mui-navigate-right">我的优惠券</a>
				</li>
			</ul>

			<ul class="mui-table-view">
				<li class="mui-table-view-cell" style="text-align: center;">
					<a href="login.html">退出登录</a>
				</li>
			</ul>
		</div>
	</div>
	</body>
	<script src="../../../mui/js/mui.min.js"></script>
	<script src="../../../js/common.js"></script>
	<script src="../../../js/ajax-common.js"></script>	
	<script src="../../../js/jquery-2.1.1.min.js"></script>
	<script>
		mui.init();
		//初始化单页view
		mui.ready(function(){
			var url = "/customer/list";
			var success = function(response) {
				var wechatCustomer=response.wechatCustomer;
				setWechatCustomer(wechatCustomer);
			};
			ajaxFunc(url, success);
		});
		function setWechatCustomer(wechatCustomer){
			var wechatHtml="";
			if(wechatCustomer.id==0){
				wechatHtml=wechatHtml+'<li class="mui-table-view-cell mui-media"><a class="mui-navigate-right">'+
				'<img class="mui-media-object mui-pull-left head-img" id="head-img">'+
				'<div class="mui-media-body"><font size="3">登录/注册</font></div></a></li>';
			}else{
				wechatHtml=wechatHtml+'<li class="mui-table-view-cell mui-media" ><a class="mui-navigate-right"><img class="mui-media-object mui-pull-left head-img" id="head-img" src="'+
				imageCxt+wechatCustomer.headImgUrl+'"><div class="mui-media-body">Hello '+wechatCustomer.nickName+'<p class="mui-ellipsis">账号:'+
				wechatCustomer.nickName+'</p></div></a></li>';
			}
			$("#wechat").html(wechatHtml);
		}
		/*全部订单*/
		document.getElementById("allOrder").addEventListener('tap',function(){
			mui.openWindow({
				id:'orderList',
				url:'../order/orderList.html',
			});
			window.localStorage.act="a";
		});
		/*待付款*/
		document.getElementById("pendingPay").addEventListener('tap',function(){
			mui.openWindow({
				id:'orderList',
				url:'../order/orderList.html',
			});
			window.localStorage.act="p";
		});
		/*待收货*/
		document.getElementById("pendingGoods").addEventListener('tap',function(){
			mui.openWindow({
				id:'orderList',
				url:'../order/orderList.html',
			});
			window.localStorage.act="g";
		});
		/*我的地址*/
		document.getElementById("address").addEventListener('tap',function(){
			
		});
		/*点击购物车标签*/
		document.getElementById("cart").addEventListener('tap',function(){
			mui.openWindow({
				id:'cart',
				url:'../cart/cart.html',
			});
		});
		/*点击首页*/
		document.getElementById("home").addEventListener("tap",function(){
			mui.openWindow({
				id:'index',
				url:'../index.html',
			});
		});
		/*点击会员*/
		document.getElementById("user").addEventListener("tap",function(){
			mui.openWindow({
				id:'userInfo',
				url:'../user/userInfo.html',
			});
		});
	</script>

</html>